//
//  KTNavTitleBtn.m
//  KTLotteryTicket
//
//  Created by CoolKi on 16/3/6.
//  Copyright © 2016年 CoolKi. All rights reserved.
//

#import "KTNavTitleBtn.h"

@implementation KTNavTitleBtn

//返回按钮中图片标题的frame
//- (CGRect)imageRectForContentRect:(CGRect)contentRect{};
//- (CGRect)titleRectForContentRect:(CGRect)contentRect{};

- (void)layoutSubviews{
    
    [super layoutSubviews];
    if (self.imageView.x < self.titleLabel.x) {
        self.titleLabel.x = self.imageView.x;
        self.imageView.x = CGRectGetMaxX(self.titleLabel.frame);
    }
}

- (void)setTitle:(NSString *)title forState:(UIControlState)state{
    [super setTitle:title forState:state];
    
    [self sizeToFit];
}

@end
